package org.akushe.core.repository;

import javax.jcr.Credentials;
import javax.jcr.Repository;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;


public class ManagedSessionFactory extends AbstractThreadLocalSessionFactory implements WorkSpaceSessionFactory {
    
	static final Logger logger = LoggerFactory.getLogger(ManagedSessionFactory.class);

    private final Repository repository;
    private final Credentials credentials;

    public ManagedSessionFactory(Repository repository, Credentials credentials)
    {
        if (repository == null)
        {
            throw new IllegalArgumentException("repository cannot be null");
        }

        if (credentials == null)
        {
            throw new IllegalArgumentException("credentials cannot be null");
        }
        this.credentials = credentials;
        this.repository = repository;
    }
	@Override
	protected Credentials getCredentials() {
		return this.credentials;
	}

	@Override
	protected Repository getRepository() {
		return this.repository;
	}

}
